package edu.whut.mall.portal.service;

import edu.whut.mall.common.api.CommonPage;
import edu.whut.mall.common.exception.MallException;
import edu.whut.mall.portal.domain.PayInfoParams;
import edu.whut.mall.portal.vo.GroupBuyOrderVo;
import edu.whut.mall.portal.vo.GroupBuyRecordVo;

/**
* @program: d9lab-mall
* @description: 团购订单功能接口
* @author:  Wayne
* @create: 2020-05-21 16:15:55
**/

public interface IGroupBuyOrderService {
    /**
     * 用户下团购订单
     * @param payInfoParams
     * @return
     */
    GroupBuyOrderVo createGroupBuyOrder(PayInfoParams payInfoParams) throws MallException;

    /**
     * 根据用户id和订单状态来获取团购记录
     * @param userId
     * @param status
     * @return
     */
    CommonPage<GroupBuyRecordVo> getGroupBuyRecordVosByUserIdAndRecordStatusAndUserType(Integer pageNum, Integer size, Long userId, Integer status, Integer userType);
    /**
     * 根据用户id和订单状态来获取团购记录
     * @param ruleId
     * @param status
     * @return
     */
    CommonPage<GroupBuyRecordVo> getGroupBuyRecordProcessingVos(Integer pageNum, Integer size, Long ruleId, Integer status);

    /**
     * 根据记录和userId来获取订单详情
     * @param recordId
     * @return
     */
    GroupBuyOrderVo getGroupBuyOrderVoByRecordIdAndUserId(Long recordId, Long userId);


    /**
     * 根据订单状态来获取订单
     * @param userId 用户id
     * @param orderStatus 订单状态
     * @return
     */
    CommonPage<GroupBuyOrderVo> getGroupBuyOrderVoByOrderStatus(Integer pageNum, Integer size, Long userId, Integer orderStatus);

    /**
     * 根据订单号获取订单详情
     * @param orderNo 订单号
     * @return
     */
    GroupBuyOrderVo getGroupBuyOrderVoByOrderNo(String orderNo);

    /**
     * 确认收货
     * @param orderNo
     * @return
     */
    Integer confirmReceipt(String orderNo);

    /**
     * 删除订单
     * @param orderNo
     * @return
     */
    Integer deleteOrder(String orderNo);




}